<template>
	<view class="content">
		<!-- 注意，如果需要兼容微信小程序，最好通过setRules方法设置rules规则 -->
		<u--form
				labelPosition="left"
				:model="model1"
				:rules="rules"
				ref="uForm"
				labelWidth='70'
		>
			<u-form-item
					label="姓名"
					prop="userInfo.name"
					borderBottom
					ref="item1"
					labelWidth='70'
			>
				<u--input
						v-model="model1.userInfo.name"
						border="none"
				></u--input>
			</u-form-item>
			<u-form-item
					label="电话"
					prop="userInfo.phone"
					borderBottom
					ref="item1"
					labelWidth='70'
			>
				<u--input
						v-model="model1.userInfo.phone"
						type='number'
						border="none"
				></u--input>
			</u-form-item>
			<u-form-item
					label="地区"
					prop="userInfo.city"
					borderBottom
					ref="item1"
					labelWidth='70'
			>
				<view class="input" @tap="chooseCity">
					{{region.label}}
				</view>
			</u-form-item>
			<u-form-item
					label="详细地址"
					prop="userInfo.address"
					borderBottom
					ref="item1"
					labelWidth='70'
			>
				<u--input
						v-model="model1.userInfo.address"
						border="none"
				></u--input>
			</u-form-item>
			<u-form-item
					label="性别"
					prop="userInfo.sex"
					borderBottom
					@click="showSex = true; hideKeyboard()"
					ref="item1"
					labelWidth='70'
			>
				<u--input
						v-model="model1.userInfo.sex"
						disabled
						disabledColor="#ffffff"
						placeholder="请选择性别"
						border="none"
				></u--input>
				<u-icon
						slot="right"
						name="arrow-right"
				></u-icon>
			</u-form-item>
		</u--form>
		<u-action-sheet
				:show="showSex"
				:actions="actions"
				title="请选择性别"
				description="如果选择保密会报错"
				@close="showSex = false"
				@select="sexSelect"
		>
		</u-action-sheet>
		<u-form-item
				label="主诉"
				prop="userInfo.reason"
				borderBottom
				ref="item1"
				labelWidth='70'
		>
			<u--textarea disabled v-model="model1.userInfo.reason" placeholder="请输入内容" count></u--textarea>
		</u-form-item>
		<u-form-item
				label="现病史"
				prop="userInfo.midhistory"
				borderBottom
				ref="item1"
				labelWidth='70'
		>
			<u--textarea disabled v-model="model1.userInfo.midhistory" placeholder="请输入内容" count></u--textarea>
		</u-form-item>
		<u-form-item
				label="既往史"
				prop="userInfo.preson"
				borderBottom
				ref="item1"
				labelWidth='70'
		>
			<u--textarea disabled v-model="model1.userInfo.preson" placeholder="请输入内容" count></u--textarea>
		</u-form-item>
		<u-form-item
				label="体格检查"
				prop="userInfo.physique"
				borderBottom
				ref="item1"
				labelWidth='70'
		>
			<u--textarea disabled v-model="model1.userInfo.physique" placeholder="请输入内容" count></u--textarea>
		</u-form-item>
		<u-form-item
				label="忘闻切诊"
				prop="userInfo.forgetting"
				borderBottom
				ref="item1"
				labelWidth='70'
		>
			<u--textarea disabled v-model="model1.userInfo.forgetting" placeholder="请输入内容" count></u--textarea>
		</u-form-item>
		<u-form-item
				label="诊断"
				prop="userInfo.diagnosis"
				borderBottom
				ref="item1"
				labelWidth='70'
		>
			<u--textarea disabled v-model="model1.userInfo.diagnosis" placeholder="请输入内容" count></u--textarea>
		</u-form-item>
		<u-form-item
				label="辩证"
				prop="userInfo.dialectic"
				borderBottom
				ref="item1"
				labelWidth='70'
		>
			<u--textarea disabled v-model="model1.userInfo.dialectic" placeholder="请输入内容" count></u--textarea>
		</u-form-item>
		
	</view>
</template>

<script>
export default {
	data() {
		return {
			showSex: false,
			region:{label:"请点击选择地址",value:[],cityCode:""},
			cityPickerValue: [0, 0, 1],
			model1: {
				userInfo: {
					name: 'uView UI',
					phone:'',
					sex: '',
					city:'',
					address:'',
					reason:'',
					midhistory:'',
					preson:'',
					physique:'',
					diagnosis:'',
					forgetting:'',
					dialectic:''
				},
			},
			actions: [{
				name: '男',
				},
				{
					name: '女',
				},
				{
					name: '保密',
				},
			],
			radio: '',
			switchVal: false
		};
	},
	methods: {
		
	},
	
	onReady() {
		//如果需要兼容微信小程序，并且校验规则中含有方法等，只能通过setRules方法设置规则。
    	this.$refs.uForm.setRules(this.rules)
    },
};
</script>

<style lang="scss">
.content{
	padding: 20upx;
	.submit{
		margin: 40upx 0;
	}
}
</style>
